#include "PCH.h"
#ifdef _WIN32
#include "Win32Client.h"
#endif
#include "AppLoop.h"

#include "DeCore.h"
#include "D3D11RenderDevice.h"

TCHAR*			DefaultWndTitle		= TEXT("DeviousRenderer");

const int		DefaultWndWidth		= 1024;
const int		DefaultWndHeight	= 650;

namespace DeviousRenderer
{

AppLoop::AppLoop()
: mClient(NULL)
{
	
}

AppLoop::~AppLoop()
{

}

int AppLoop::PreInit( const char* CmdLine )
{
	return 0;
}

int AppLoop::Init( )
{
	mClient = new Win32Client();
	mClient->Init();
	mClient->SetCaption(std::wstring(TEXT("DeviousRenderer")));

	GRenderDevice = new D3D11RenderDevice();
	GRenderTargets = new DeRenderTargets();


	return true;
}

void AppLoop::Exit()
{
	mClient->Exit();
	SAFE_DELETE(mClient);
	SAFE_DELETE(GRenderDevice);
	SAFE_DELETE(GRenderTargets);
}

void AppLoop::Loop()
{
	mClient->Loop();
}

bool AppLoop::IsRequestingExit()
{
	return true;
}

void AppLoop::MessageLoop()
{

}

}